//never表示永远都不会发生值的类型

function fn(): never{
    throw new Error("手动错误")
}
function fn1(): never{
    while (true){
        console.log(1)
    }
}

function checkType(msg: string | number | boolean){
    let str = "";
    switch (typeof msg){
        case "string":
            str = "string"
            break;
        case "number":
            str = "number"
            break;
        case "boolean":
            str = "boolean"
            break;
        default:
            let check: never = msg;
    }
    return msg+","+str
}
checkType("123")
checkType(123)


checkType(true)


